package day02;
// 变量的演示
public class VarDemo {
    public static void main(String[] args) {
        //1) 变量的声明:----相当于在银行开了个账户
        int a; //声明一个整型的变量, 名为a
        int b,c,d; //声明三个整型的变量, 名为b,c,d
        //int a; //编译错误, 变量不能同名

        //2) 变量的初始化:----相当于给账户存钱
        int e = 250; //声明整型变量e并复制为250----开户的同时存钱
        int f;  //声明整型变量f----先开户
        f = 250; //给变量f复制为250----后存钱
        f = 360; //修改变量f的值为360
        int g=5, h=8, i=10; //声明三个整型变量g,h,i, 并分别赋值为5,8,10

        //3) 变量的访问:----使用的是账户里面的钱
        int j = 5; //声明整型变量j并赋值为5
        int k = j+10; //取出j的值5, 加10后, 再赋值给变量k
        System.out.println(k); //输出变量k的值15
        System.out.println("k"); //输出k, 双引号中的原样输出
        j = j+10; //在j本身基础之上增10
        System.out.println(j); //15
        int balance = 5000; //账户余额
        balance = balance-1000; //取款1000
        System.out.println(balance); //4000
        //System.out.println((m)); //编译错误, 变量m未声明
        int m;
        //System.out.println(m); //编译错误, 变量m未初始化

        //4) 变量的命名:----相当于给账户起名
        int a1,a_5$,_3c,$5b;
        //int a*b; //编译错误, 不能包含*号等特殊符号
        //int 1a; //编译错误, 不能以数字开头
        int aa = 5;
        //System.out.println(aA); //编译错误, 严格区分大小写
        //int class; //编译错误, 不能使用关键字
        int 年龄; //正确, 但不建议
        int nianLing; //必须杜绝
        int age; //建议"英文的见名之意"
        int score,myScore,myJavaScore; //建议"小驼峰命名法"

        //------------------------------------------------------------------
        //第二遍
        /*
        int a1,a_5$,_3c,$5b;
        int aa = 5;
        int 年龄;
        int nianLing;
        int age;
        int score,myScore,myJavaScore;

        //第三遍
        int a1,a_5$,_3c,$5b;
        int aa = 5;
        int 年龄;
        int nianLing;
        int age;
        int score,myScore,myJavaScore;

        //第四遍
        int a1,a_5$,_3c,$5b;
        int aa = 5;
        int 年龄;
        int nianLing;
        int age;
        int score,myScore,myJavaScore;

        //第五遍
        int a1,a_5$,_3c,$5b;
        int aa = 5;
        int 年龄;
        int nianLing;
        int age;
        int score,myScore,myJavaScore
        //-------------------------------------------------------------------
        //第二遍
        int j = 5;
        int k = j+10;
        System.out.println(k);
        System.out.println("k");
        j = j+110;
        System.out.println(j);
        int balance = 5000;
        balance = balance-1000;
        System.out.println(balance);

        //第三遍
        int j = 5;
        int k = j+10;
        System.out.println(k);
        System.out.println("k");
        j = j+10;
        System.out.println(j);
        int balance = 5000;
        balance = balance-1000;
        System.out.println(balance);

        //第四遍
        int j = 5;
        int
        //------------------------------------------------------------------
        //第一遍
        int a;
        int b,c,d;

        int e = 250;
        int f;
        f = 250;
        f = 360;
        int g=5, h=8, i=10;

        //第二遍
        int a;
        int b,c,d;

        int e = 250;
        int f;
        f = 250;
        f =360;
        int g=5, h=8, i=10;

        //第三遍
        int a;
        int b,c,d;

        int e = 250;
        int f;
        f = 250;
        f = 360;
        int g=5,h=8,i=10;

        //第四遍
        int a;
        int b,c,d;

        int e = 250;
        int f;
        f = 250;
        f = 360;
        int g=5,h=8,i=10;

        //第五遍
        int a;
        int b,c,d;

        int e = 250;
        int f;
        f = 250;
        f = 360;
        int g=5,h=8,i=10;

        //第六遍
        int a;
        int b,c,d;

        int e = 250;
        int f;
        f = 250;
        f = 360;
        int g=5,h=8,i=10;

         */

    }
}
